#include "MyContactReport.h"

void MyContactReport::onContactNotify(NxContactPair& pair, NxU32 events)
{
	if (events == NX_NOTIFY_ON_TOUCH)
	{
		NxActor *actor1 = pair.actors[0];
		NxActor *actor2 = pair.actors[1];
		if (flag)
			return;
		if (!strcmp(actor1->getName(), "person") && !strcmp(actor2->getName(), "cube"))
		{
			actor2->userData = NULL;
			actor2->getScene().releaseActor(*actor2);
			flag = true;
		}
		else if (!strcmp(actor1->getName(), "cube") && !strcmp(actor2->getName(), "person"))
		{
			actor1->userData = NULL;
			actor1->getScene().releaseActor(*actor1);
			flag = true;
		}
	}

}